﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LibraryManagement.Custom_Controls
{
    public partial class libListBox : ListBox
    {
        public libListBox()
        {
            InitializeComponent();
        }

        public void SetDataSource(IEnumerable<dynamic> datasource, String displayMemeber, String valueMemeber)
        {
            this.DataSource = datasource;
            this.DisplayMember = displayMemeber;
            this.ValueMember = valueMemeber;
            this.SelectedIndex = -1;
        }

    }
}
